package util.rm.quml.gemom;

import java.util.*;
import java.text.*;

/*
 * COPYRIGHT DISCLAIMER
 * Synopsis: All the source codes presented in this document are intellectual
 * properties of Queen Mary, University of London.
 * 
 * @year 2010
 * @author Peng Jiang, John Bigham, Jiayi Wu Jinfu Wang------------QMUL
 * @version 1.0 
 */

public class ActualDataSeries {

    private double msgPerMin[];
	private Date dates[];
	
	public ActualDataSeries(String nameSeries)
	{
		String query = "select messages,time from ["+ nameSeries +"$];";
    	ExcelReader exr = new ExcelReader();
      	Vector<Vector<String>> vec= exr.getTable(query);
    	
    
    
    	msgPerMin= new double[vec.get(0).size()];
    	dates= new Date[vec.get(1).size()];
    	DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    	    	
    	for(int i=0;i<vec.get(0).size();i++)
    		{
    			msgPerMin[i]= Double.parseDouble(vec.get(0).get(i));
    			try{dates[i]= dateformat.parse(vec.get(1).get(i));}
    			catch(Exception e){System.out.println();}
    		}
	}
	
	public Date[] getDates(){return dates;}
	public double[] getMsgPerMin(){return msgPerMin;}
    
}
